package com.nbsaas.boot.user.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "用户地址", model = "用户地址")
@Entity
@Table(name = "bs_user_address")
@Comment("用户地址表")
public class UserAddress extends AbstractEntity {

    @Comment("用户ID")
    @FormField(title = "用户ID", sortNum = "1", grid = true, required = true)
    private Long userId;

    @Comment("收货人姓名")
    @FormField(title = "收货人姓名", sortNum = "2", grid = true, required = true)
    @Column(length = 50, nullable = false)
    private String receiverName;

    @Comment("收货人手机号")
    @FormField(title = "收货人手机号", sortNum = "3", grid = true, required = true)
    @Column(length = 20, nullable = false)
    private String receiverPhone;

    @Comment("省份")
    @FormField(title = "省份", sortNum = "4", grid = true)
    @Column(length = 50)
    private String province;

    @Comment("城市")
    @FormField(title = "城市", sortNum = "5", grid = true)
    @Column(length = 50)
    private String city;

    @Comment("区县")
    @FormField(title = "区县", sortNum = "6", grid = true)
    @Column(length = 50)
    private String district;

    @Comment("详细地址")
    @FormField(title = "详细地址", sortNum = "7", grid = true, required = true)
    @Column(length = 500, nullable = false)
    private String detailAddress;

    @Comment("邮政编码")
    @FormField(title = "邮政编码", sortNum = "8", grid = true)
    @Column(length = 10)
    private String postcode;

    @Comment("是否默认地址")
    @FormField(title = "默认地址", sortNum = "9", grid = true, type = InputType.select)
    private Boolean isDefault;

    @Comment("地址标签")
    @FormField(title = "地址标签", sortNum = "10", grid = true)
    @Column(length = 20)
    private String addressTag;

    @Comment("经度")
    @FormField(title = "经度", sortNum = "11", grid = true, type = InputType.el_input_number)
    @Column(precision = 10, scale = 6)
    private java.math.BigDecimal longitude;

    @Comment("纬度")
    @FormField(title = "纬度", sortNum = "12", grid = true, type = InputType.el_input_number)
    @Column(precision = 10, scale = 6)
    private java.math.BigDecimal latitude;

    @Comment("地址状态")
    @FormField(title = "地址状态", sortNum = "13", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status;
} 